package controle;

import visao.TelaRelatorioPreventiva;

import javax.swing.JFrame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ControleRelatorioPreventiva implements ActionListener{

	private TelaRelatorioPreventiva visao;
	private static ControleRelatorioPreventiva singleton = null;
	
	public static ControleRelatorioPreventiva getInstancia()
	{
		if (singleton == null)
			singleton = new ControleRelatorioPreventiva();
		
		return singleton;
	}	
	
	public void habilita()
	{
		visao.setModal(true);
		visao.setVisible(true);	
	}
	
	public void configura(TelaRelatorioPreventiva visao)
	{
		this.visao = visao;
			
		visao.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		
		visao.modoInicial();
		visao.setOuvinte(this);
		visao.setVisible(false);
		//con = DBUtil.getConnection();
	}
	
	public void actionPerformed(ActionEvent e) 
	{
	}
}
